package com.thoughtservice.jspdoc.utils;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Properties;

import org.apache.commons.lang.exception.ExceptionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class FolderFilterUtils {
	
	private final static Logger LOG = LoggerFactory.getLogger(FolderFilterUtils.class);
	
	private static ArrayList<String> filterList;
	
	static{
		Properties p = new Properties();
		try {
			p.load(FolderFilterUtils.class.getResourceAsStream("/folderfilterlists.properties"));
			filterList = new ArrayList<String>(Arrays.asList(p.getProperty("FILTER_LIST").split("\\s*,\\s*")));
			
		} catch (FileNotFoundException e) {
			LOG.error("{}", ExceptionUtils.getFullStackTrace(e));
		} catch (IOException e) {
			LOG.error("{}", ExceptionUtils.getFullStackTrace(e));
		}		
	}
	
	
	public static ArrayList<String> getFilterList(){
		return filterList;
	}
}
